package com.linhai.mybatis.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.linhai.mybatis.model.Article;
import com.linhai.mybatis.model.User;
import com.linhai.mybatis.dao.IUserDao;
import com.linhai.mybatis.service.IUserService;

@Service
public class UserService implements IUserService {
	
	@Autowired
    private IUserDao userDao;
	
	public int insertUser(User user) {
		return userDao.insertUser(user);
	}
	
	public List<User> findUsersByName(String userName){
		return userDao.findUsersByName(userName);
	}
	
	public List<Article> findArticlesByUserID(int userID){
		return userDao.findUserArticles(userID);
	}
}
